<?php 
get_header();
?>

<div id="content" class="narrowcolumn">

<?php
if ($photo) {
		?>
<h2><?php echo "<a href=\"" . $photo->url . $photo->metadata['file'] . "\" target=\"_blank\">" . $photo->title . "</a>";?></h2>
<div id="photo">
<?php if ($photo->description) {?>
<div id="description">
    <?php echo  apply_filters('the_content', $photo->description); ?>
</div>
<?php } ?>
<br/> <table border="0" width="100%"><tr> <td colspan="3" align="center"> <?php if ($photo->metadata['width'] > 400) echo "<a href=\"" . $photo->url . $photo->metadata['file'] . "\" target=\"_blank\">";?>


<img src="<?php echo $photo->url . $photo->metadata['file'] ;?>" width="<?php echo ($photo->metadata['width'] > 400) ? "400" : $photo->metadata['width'] ;?>"/><?php if ($photo->metadata['width'] > 400) echo "</a>";?>
 </td> </tr> <tr> 	<td width="25%"><?php if ($prev != '') { echo "<a href='" . get_bloginfo('siteurl') . "/" . $_SERVER['REQUEST_URI'] . "/" . $albumID . "/" . $prev . "'>&laquo;&laquo;</a>"; } ?></td><td width="50%" align="center"><?php echo "<a href=\""  . get_bloginfo('siteurl') . "/" . $_SERVER['REQUEST_URI'] . "/" . $albumID . "\">" . __('Back to the album', 'wpsary') . "</a>"; ?></td> 	<td width="25%" align="right"><?php if ($next != '') { echo "<a href='" . get_bloginfo('siteurl') . "/" . $_SERVER['REQUEST_URI'] . "/" . $albumID . "/" . $next . "'>&raquo;&raquo;</a>"; } ?></td> </tr></table>

 </div>
<?php
} else {
?>

		<h2><?php _e('No image found', 'wpsary') ;?></h2>
<?
}

?>

</div>

<?php
get_sidebar();
get_footer();
?>